package com.hz.framework.util;


import java.util.Calendar;
import java.util.Timer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.hibernate.Session;

import com.hz.framework.dao.CommonDao;
//import com.hz.mail.manager.AcquireMail;
//import com.hz.tixing.TiXing;

public class InitService extends HttpServlet {

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * Initialization of the servlet. <br>
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		//初始化连接池
		CommonDao dao=new CommonDao();
		Session session=dao.getHibernateTemplate();
		session.close();
		/**定时获取节日提醒**/
		
		//服务器启动自动运行
		//Analysis_Manage am=new Analysis_Manage();
		//am.run();
		
		//定时获取节日提醒
//		Timer timer=new Timer();
//		Calendar c=Calendar.getInstance();
//		c.set(Calendar.HOUR_OF_DAY, 23);
//		c.set(Calendar.MINUTE, 59);
//		c.set(Calendar.SECOND,0);
//		timer.schedule(new Analysis_Manage(),c.getTime(),1000*60*60*24);
		
	}

}
